#include "pointer.h"

extern u8 center_png[];
extern u8 sight_png[];

Pointer::Pointer()
{
	Image* cImage = new Image();
	
	if(cImage->LoadImage(center_png, IMG_LOAD_TYPE_BUFFER) != IMG_LOAD_ERROR_NONE)exit(0);
	_center.SetImage(cImage);
	
	int i = _images.size();
	
	_images.push_back(new Image());
	if(_images[i]->LoadImage(sight_png, IMG_LOAD_TYPE_BUFFER) != IMG_LOAD_ERROR_NONE)exit(0);
	_ptrSprite.SetImage(_images[0]);
	
	
	_portalASet = false;
	_portalBSet = false;
}

Pointer::~Pointer()
{

}

void Pointer::Reset()
{
	_portalASet = false;
	_portalBSet = false;
}

void Pointer::SetPosition(float x, float y)
{
	_ptrSprite.SetPosition(x, y);
	
	_center.SetPosition(x+_ptrSprite.GetWidth()/2.0-2.0, y+_ptrSprite.GetHeight()/2.0-2.0);
}

void Pointer::SetRotation(float a)
{
	_ptrSprite.SetRotation(a);
}

void Pointer::Render()
{
	//TODO add brains here to see if portals are set, if so, use portal images.

	_ptrSprite.Draw();
}
